package com.timk.goserver.client.services;

import java.util.List;
import java.util.Set;

import com.google.gwt.user.client.rpc.AsyncCallback;

/**
 * Async interface for GameService.
 * @author TKington
 *
 */
public interface GameServiceAsync {
	/**
	 * Returns the list of game ids for a given player
	 * @param username
	 * @param filter type of games to display
	 * @param firstResult the first game to return
	 * @param maxResults the number of games to return
	 * @param callback returns List&lt;ClientGameInfo&gt;
	 */
	void getGames(String username, int filter, int firstResult,
			int maxResults, AsyncCallback callback);
	
	/**
	 * Gets a game by id
	 * @param gameid the id
	 * @param callback returns the ClientGameInfo
	 */
	void getGame(int gameid, AsyncCallback callback);
	
	/**
	 * Plays moves in a game
	 * @param gameid the game id
	 * @param firstMoveNum the move number of the first move
	 * @param moves ArrayList&lt;Point&gt; of moves
	 * @param comment the comment
	 * @param callback returns integer error code
	 */
	void playMoves(int gameid, int firstMoveNum, List moves,
			String comment, AsyncCallback callback);
	
	/**
	 * Submits the list of dead stones for scoring
	 * @param gameid the game id
	 * @param deadStones Set&lt;Point&gt; of dead stones
	 * @param comment the comment
	 * @param callback returns integer error code
	 */
	void submitDeadStones(int gameid, Set deadStones, String comment,
			AsyncCallback callback);
	
	/**
	 * Resumes a game to dispute the status of groups
	 * @param gameid the game id
	 * @param callback integer error code
	 */
	void resumeGame(int gameid, AsyncCallback callback);
	
	/**
	 * Deletes a game
	 * @param gameid the game id
	 * @param callback returns integer error code
	 */
	void deleteGame(int gameid, AsyncCallback callback);
	
	/**
	 * Resigns a game
	 * @param gameid the game id
	 * @param comment the comment
	 * @param callback returns integer error code
	 */
	void resignGame(int gameid, String comment, AsyncCallback callback);
	
	/**
	 * Set private notes for the game
	 * @param gameid the game id
	 * @param notes
	 * @param callback returns integer error code
	 */
	void setNotes(int gameid, String notes, AsyncCallback callback);
}
